import "./assets/main.css";
// normalize.css  // 重置默认样式
// import 'babel-polyfill'
import { createApp } from "vue";
import router from "./router";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import "element-plus/dist/index.css";
// import 'element-plus/theme-chalk/dark/css-vars.css'

// 1. 引入你需要的组件
import { PullRefresh, Swipe, SwipeItem, Tabbar, TabbarItem } from "vant";
// 2. 引入组件样式
import "vant/lib/index.css";

import VXETable from "vxe-table";
import "vxe-table/lib/style.css";

import App from "./App.vue";
import { useMenuStore } from "@/stores/menu";

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)


app.use(pinia);

const { registerRoute, menusList } = useMenuStore()

registerRoute(menusList);

app.use(router);
app.use(ElementPlus);
app.use(VXETable);
app.use(PullRefresh);
app.use(Swipe);
app.use(SwipeItem);
app.use(Tabbar);
app.use(TabbarItem);

app.mount("#app");
